package com.example.javabeantest;

import javafx.animation.Transition;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class FirstServlet extends HttpServlet {
    public FirstServlet() {super();}
    public void destroy(){super.destroy();}
    public void init() throws ServletException{
        super.init();
    }
    protected void doPost(HttpServletRequest request, HttpServletMapping response) throws ServletException, IOException{
        response.setCharacterEncoding("UFT-8");
        response.setContntType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<!DOCTYPE HTML PUBLIC\"-//WSC//DTD HTML 4.01" + Transitional//EN\">");
                out.println("<HTML>");
        out.println("<HEAD><TILTE>动态生成的HTML文档</TITLE></HEAD>");
        out.println("<BODY>");
        out.println("table border='0' align='center'>");
        out.println("<tr><td bgcolor='skyblue'colspan=2>动态生成HTML文档</td></tr>");
        out.println("</table>");
        out.println("<BODY>");
        out.println("<HTML>");
        out.flush();
        out.close();
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException{
        doPost(request, response);
    }
}
